package cn.gzsxt.po;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

/**
 * t_build楼栋表
 */
public class Build {
	private int id;
	
	//transient 不会被序列化
	transient private String buildnum;
	@JSONField(name="name")//自定义序列化json串对应的属性名称
	private String buildname;
	//fastjson自带的注解,当前字段对应的属性不会被序列化
	@JSONField(serialize = false)
	private String addr;
	
	
	public Build(int id, String buildnum, String buildname, String addr) {
		super();
		this.id = id;
		this.buildnum = buildnum;
		this.buildname = buildname;
		this.addr = addr;
	}
	public Build() {
		super();
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getBuildnum() {
		return buildnum;
	}
	public void setBuildnum(String buildnum) {
		this.buildnum = buildnum;
	}
	public String getBuildname() {
		return buildname;
	}
	public void setBuildname(String buildname) {
		this.buildname = buildname;
	}
	public String getAddr() {
		return addr;
	}
	public void setAddr(String addr) {
		this.addr = addr;
	}
	@Override
	public String toString() {
		return "Build [id=" + id + ", buildnum=" + buildnum + ", buildname="
				+ buildname + ", addr=" + addr + "]";
	}
	
	public static void main(String[] args) {
		
		Build build = new Build();
		build.setAddr("元岗路");
		build.setBuildnum("001号楼");
		build.setBuildname("一号楼");
		
		System.out.println(JSON.toJSONString(build));
		
	}
	
}
